import axios from 'axios';
// 书城的banner
export const getBanner = () =>
    axios.get('/m1/banner/list', {
        params: { columnId: '8213' }
    })

// 主打推荐
export const getRecommendMain = () =>
    axios.post('/m1/recommend/listpageNew',
        {
            columnId: '8214',
            pageNo: '1',
            pageSize: '3'
        },
        {
            headers: {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    )


// 本期热销
export const currentHot = () =>
    axios.post('/m1/recommend/listpageNew',
        {
            columnId: '8210',
            pageNo: '1',
            pageSize: '6',
            channel: '1'
        },
        {
            headers: {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    )

//限时免费
export const limitFree = () =>
    axios.get('/m1/limitfree/list', {
        params: {
            channel: '4',
            sb: '1',
        }
    }

    )

//都市爽文+ 悬疑探险
export const CityMsg = () =>
    axios.get('/m1/novelColumnFree/getUsedList', {
        params: {
            channel: '1',
            model: '精选',
        }
    }

    )

// 新书速递
export const newBookSend = () =>
    axios.post('/m1/recommend/listpageNew',
        {
            columnId: '8211',
            pageNo: '1',
            pageSize: '3',
            channel: '1'
        },
        {
            headers: {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    )


//小编推荐
export const smallCompile = () =>
    axios.get('/m1/recommend/smallCompile')


// 排行榜单
export const rankList = () =>
    axios.get('/m1/ranking/page', {
        params: {
            columnId: '6164',
            pageNo: '2',
            key: '3'
        }
    })

// 本期大神
export const bigGod = () =>
    axios.get('/m1/author/famousAuthorPageList', {
        params: {
            pageSize: '3',
            pageNo: '1',
            channel: '1'
        }
    })

//读者推荐
export const readRecommend = () =>
    axios.get('/m1/comment/commentSquarePage', {
        params: {
            pageSize: '3',
            pageNo: '1',
            type: '1'
        }
    })

//和xxx一样好的书
export const goodBook = () =>
    axios.get('/m1/story/recentReadRecommend', {
        params: {
            channel: '1'
        }
    })


//悬疑+都市+玄幻
export const getGroup = (columnId: string) =>
    axios.post('/m1/recommend/listpageNew',
        {
            columnId: columnId,
            pageNo: '1',
            pageSize: '4'
        },
        {
            headers: {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }
    )


//专题
export const Topics = () =>
    axios.get('/m1/topic/listnew', {
        params: {
            channel: '1',
            pageSize: '3',
            page: '1'
        }
    })



export const getRecommend = () =>
    axios.get('/m1/story/getMenuList')
//畅销
export const getListpageNew = () =>
    axios.post("m1/recommend/listpageNew",
        {
            columnId: 8541,
            pageNo: 1,
            pageSize: 3
        },
        {
            headers: {
                "content-type": "application/x-www-form-urlencoded"
            }
        }

    )
//福利-Banana
export const getBanana = () =>
    axios.get("m1/banner/list?columnId=8308")
//书架
export const getMystories = () =>
    axios.get("m1/shelf/myStories", {
        headers: {
            "x-i": "89436213d2b9c1c82a8b1bad2cdfb221bbd501b4e556a4d186f6450fae378d091bd6bec6df0a8d68cfef37fb803706aef2b0de3c3f3fe07d56a4673dc8d423f71616f2a401a0f3741ad42d2632d19f69",
            "x-s": "0a75a4bf1d38193e1248c9f1ce329474",
        }
    })
//排行榜list
export const getNewcolumns = () =>
    axios.get("m1/ranking/newColumns?channel=1", {
        headers: {
            c: "android/model:MuMu,SDK:Android6.0.1(API23)-huoxing/2.7.3/guanwang/000000000000000"
        }
    })
export const getPage = (columnId: number, pageNo: number, key: number) =>
    axios.get("m1/ranking/page", {
        params: {
            columnId,
            pageNo,
            key
        }
    })
//作者列表
export const getAuthorpage = (pageNo: number) =>
    axios.get("m1/author/famousAuthorPageList?pageNo=" + pageNo + "&channel=1&pageSize=10")
//作者详情
export const getAuthormessage = (uid: string) =>
    axios.get("m1/user/get?userId=" + uid, {
        headers: {
            "x-l": "89436213d2b9c1c82a8b1bad2cdfb22184c6cd8429f719098c19ecd97395152c4c0eeb167a28cbb163feefc074468d5cf2b0de3c3f3fe07d56a4673dc8d423f71616f2a401a0f3741ad42d2632d19f69",
            "x-s": "29eb22d16fbb75405342f2e6d10ca3ad"
        }
    })
//书籍详情
export const getBookInfo = (storyId: string) =>
    axios.get("m1/story/get", {
        params: {
            storyId: storyId
        },
    })
//书籍读者榜
export const getStoryRankList = (storyId: string) =>
    axios.get("m1/statisticsStoryIncome/storyRankList?storyId=" + storyId + "&page=1&pageSize=3")
//最新书籍评论
export const getComment = (storyId: string, pageNo: number) =>
    axios.get("m1/comment/page", {
        params: {
            storyId: storyId,
            pageNo: pageNo,
            pageSize: 10
        }
    })
//同类好书
export const getRelation = (storyId: string, pageNo: number, type: string) =>
    axios.get("m1/recommend/relation", {
        params: {
            storyId: storyId,
            pageNo: pageNo,
            type: type
        },
        headers: {
            "c": "android/model:MuMu,SDK:Android6.0.1(API23)-huoxing/2.7.3/guanwang/000000000000000",
            "x-i": "89436213d2b9c1c82a8b1bad2cdfb2219f5e9be04894e2d2cae5421e9874c7b31dc8d7f6702abafbaae94c71a9ecc07cf2b0de3c3f3fe07d56a4673dc8d423f71616f2a401a0f3741ad42d2632d19f69",
            "x-s": "a1d7704d257e6e90548ddbca40ecaecb"
        }
    })
//书籍目录
export const getMenu = (storyId: string) =>
    axios.get("m1/storyChapter/getChapters?storyId=" + storyId)
//作者详情
export const getAuthor = (authorId: string) =>
    axios.get("m1/author/findAuthorinFormation?authorId=" + authorId)
//热门评论
export const getHotComment = (storyId: string, pageNo: number) =>
    axios.get("m1/comment/hotPage", {
        params: {
            storyId: storyId,
            pageNo: pageNo,
            pageSize: 10
        },
        headers: {
            "x-i": "89436213d2b9c1c82a8b1bad2cdfb2217a087407d2fa0d041f9dde957cfdbf3ab710056a0322bb4cbd6e841e036e20eaf2b0de3c3f3fe07d56a4673dc8d423f71616f2a401a0f3741ad42d2632d19f69",
            "x-s": "52c772a7a0fdbfc4710a3ccf4e2e9478"
        }
    })
//做任务
export const getStoryTask = (taskType: string) =>
    axios.get("m1/storyTask/list?taskType=" + taskType, {
        headers: {
            "x-i": "89436213d2b9c1c82a8b1bad2cdfb2217a087407d2fa0d041f9dde957cfdbf3ab710056a0322bb4cbd6e841e036e20eaf2b0de3c3f3fe07d56a4673dc8d423f71616f2a401a0f3741ad42d2632d19f69",
            "x-s": "52c772a7a0fdbfc4710a3ccf4e2e9478"
        }
    })
//话题
export const getTopicinfo = (pageNo: Number) =>
    axios.get("m1/topicInfo/page?pageSize=10&pageNo=" + pageNo)
//话题详情
export const getActiveinfo = (id: string) =>
    axios.get("event/activity/specialTemplate/getTopicInfo?id=" + id)
//头条
export const getNews = () =>
    axios.get("informationflow/xxl/getNews?individual=0&page=1&num=24&channel_id=1104&cate=toutiao&position=dh2023&uuid=150181CAE038C9B87626C8D42FAF")
//道士带N条狗
export const getAd = () =>
    axios.get("api/gameboxdata?type=2&t=1699343368705")
//猜你喜欢
export const getAd2 = () =>
    axios.get("api/gameboxdata?type=6&t=1699343368707")
//热门搜索
export const getHotSearch = () =>
    axios.get("m1/search/keywords")
//搜索结果
export const getSucceed = (keyword: any) =>
    axios.get("m1/search/searchByWord?keyword=" + keyword + "&pageNo=1&pageSize=10")
//搜索建议
export const getSuggest = (keyword: any) =>
    axios.get("m1/search/searchNames?keyword=" + keyword)
//AD
export const getAd3 = () =>
    axios.post("https://sa.gdt.qq.com/rpc/gdt.display.MobileInnerService.GetMobileInnerAds", {
        "ext": { "pos_context": [{ "pos_id": "8083347645777562", "ad_count": 10 }], "req": { "login_info": { "guid": "", "login_openid": "" } } }
    }
    )